package com.lxw.oa.mapper;

import com.lxw.oa.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface ResourceMapper {
    @Select("select * from sys_oa_user where name=#{name} and password=#{password}")
    List<User> getUser(User user);

    @Delete("delete from sys_user_img where username=#{userName}")
    void userImgDel(String userName);

    @Insert("insert into sys_user_imgs (create_user,base_img,create_time,mark) values(#{userName},#{image},#{dateString},#{mark})")
    void userImgsAdd(@Param("userName") String userName, @Param("image") String image, @Param("dateString") String dateString, @Param("mark") String mark);

    @Insert("insert into sys_upload_modal (uuid_file_name,file_name,file_end_name,mark,creater,create_time) " +
            "values(#{uuid_file_name},#{fileName},#{nameEnd},#{mark},#{userName},#{dateString})")
    void addModalMessage(@Param("uuid_file_name")String uuid_file_name,@Param("fileName")String fileName,@Param("nameEnd") String nameEnd,
                         @Param("mark")String mark,@Param("userName") String userName,
                         @Param("dateString") String dateString);

    @Select("${sql}")
    List<Map<String,Object>> getOneSqlData(@Param("sql")String sql);
}
